<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <title>Insert</title>
</head>

<body>
    <?php
    include "conn.php";

    $title = $_POST['title'];
    $author = $_POST['author'];
    $content = $_POST['content'];

    $address = $_SERVER['REMOTE_ADDR'];
    $sql = "INSERT INTO `message`(`id`, `title`, `author`, `content`, `ptime`, `ip`) 
    VALUES (null,'$title','$author','$content',now(),'$address')";
    $is = $conn->query($sql);
    if ($is) {
        echo "插入数据成功 <a href=show.php>显示留言</a>";
    } else {
        echo "插入数据失败";
    }
    ?>
</body>

</html>